<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var sum1 = 0;//奇数和
        var sum2 = 0;//偶数和
        for(var i = 0; i <= 100; i++){
            if(i % 2 == 1){
                sum1 += i;
            }else{
                sum2 += i;
            }
        }
        console.log(sum1,sum2);
    </script>
</head>
<body>
    
</body>
</html>